Skip to content

Fix citation ref → refs to support multi-citation clusters#93

Merged
gvonness-apolitical merged 1 commit intomainfrom
fix/citation-refs-plural
Feb 16, 2026
Merged

Fix citation ref → refs to support multi-citation clusters#93
gvonness-apolitical merged 1 commit intomainfrom
fix/citation-refs-plural

Conversation

@gvonness-apolitical
Copy link
Collaborator

Summary

  • Breaking: Rename Citation.reference (String) → Citation.refs (Vec) to match spec and enable multi-citation clusters like [smith2023; jones2024]
  • Custom Serialize/Deserialize on Citation accepting both old "ref" (string) and new "refs" (array) for backward compatibility
  • ExtensionMark::citation() / citation_with_page() now emit "refs" array
  • Add multi_citation(), get_string_array_attribute(), get_citation_refs(), normalize_citation_attrs() helpers
  • Version bump to 0.6.0 (breaking API + wire format change)

Test plan

  • cargo test --workspace --all-features — 1030 tests pass
  • cargo clippy --workspace --all-features -- -D warnings — zero warnings
  • Backward compat: old {"ref":"smith2023"} deserializes correctly into refs: ["smith2023"]
  • Multi-ref roundtrip: {"refs":["smith2023","jones2024"]} survives serialize → deserialize
  • normalize_citation_attrs() rewrites legacy "ref""refs" in-place

Change Citation.reference (String) to Citation.refs (Vec<String>) per
spec, enabling multi-citation clusters like [smith2023; jones2024].

- Custom Serialize/Deserialize on Citation accepting both "ref" (string)
  and "refs" (array) for backward compatibility
- ExtensionMark::citation/citation_with_page now emit "refs" array
- Add multi_citation(), get_citation_refs(), normalize_citation_attrs()
- Add get_string_array_attribute() on both ExtensionMark and ExtensionBlock
- Bump version to 0.6.0 (breaking API + wire format change)
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 85.49618% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cdx-core/src/extensions/semantic/citation.rs 75.75% 16 Missing ⚠️
cdx-core/tests/conformance.rs 95.00% 2 Missing ⚠️
cdx-core/src/content/text.rs 95.23% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@gvonness-apolitical gvonness-apolitical merged commit 9cc3955 into main Feb 16, 2026
11 checks passed
@gvonness-apolitical gvonness-apolitical deleted the fix/citation-refs-plural branch February 16, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant